import request from '@/utils/request'
// 获取所有角色列表
const getRoleList = pageInfo => {
  return request({
    url: '/sys/role',
    params: pageInfo
  })
}
// 获取员工列表
const getRoleListDetail = params =>
  request({
    url: '/sys/user',
    params
  })
// 根据id删除角色
const delRole = id => request({ url: `/sys/role/${id}`, method: 'delete' })
// 添加角色
const addRole = data => request({ url: '/sys/role', method: 'post', data })
// 根据id获取角色详情
const getRoleDetail = id => request({ url: `/sys/role/${id}` })
// 根据id更新角色
const editRole = data =>
  request({ url: `/sys/role/${data.id}`, method: 'put', data })
// 根据id获取企业详情
const getCompanyDetail = id => request({ url: `/company/${id}` })

// 暴露
export {
  getRoleList,
  getRoleListDetail,
  delRole,
  addRole,
  getRoleDetail,
  editRole,
  getCompanyDetail
}
